#include <stdio.h>
#include <stdlib.h>

#include "fileControl.h"

int main()
{
    char name[20], id[20];
    int cred;
    char *name1 = &name[0];
    char *id1 = &id[0];
    int nummodules = 0;
    int counter = 0;
    int test = 0;

    printf("\nEnter name");
    scanf("%s", name);
    printf("\nEnter id");
    scanf("%s", id);
    printf("\nEnter credits value");
    scanf("%d", &cred);

    createModule(name1,id1,cred);
    nummodules = getNumModules();
    printf("\n%d", nummodules);

    while(counter < nummodules)
    {
        printf("\n%d", credits[counter]);
        counter = counter + 1;
    }

    char sname[40], sid[10], slname[40];

    printf("\nEnter student id");
    scanf("%s", sid);
    printf("\nEnter first name");
    scanf("%s", sname);
    printf("\nEnter last name");
    scanf("%s", slname);

    createStudent ( sid, sname, slname);
    counter = 0;

    while(counter < 60)
    {
        grades[counter] = -1;
        counter = counter + 1;
    }
    int output = 0;
    output = addGrades(sid);
    printf("%d", output);

    test = getGrades(sid);
    printf("%d", test);
    while(counter < 60)
    {
        printf(" %d", grades[counter]);
        counter = counter + 1;
    }
    test = 0;
    test = getStudent(sid);
    printf("%s", student_f_name);
    printf("%s", student_l_name);
    return 0;

}
